function Bullet_Ball(){

    this.width = 0;
    this.height = 0;

    this.MapLeft = 0;
    this.MapTop = 0;
    this.MapRight = 0;
    this.MapBottom = 0;

    this.speedX = 0;
    this.speedY = 0;
    this.posX = 0;
    this.posY = 0;
    this.lastPosX = 0;
    this.lastPosY = 0;
    this.visible = false;
    this.img;
    this.attack = 0;

    this.InitBullet = function(width, height, MapRight, MapBottom, speedX, speedY, posX, posY, img, attack) {
        this.width = width;
        this.height = height;
        this.MapLeft = -width;
        this.MapTop = -height;
        this.MapRight = MapRight;
        this.MapBottom = MapBottom;
        this.speedX = speedX;
        this.speedY = speedY;
        this.posX = posX;
        this.posY = posY;
        this.lastPosX = posX;
        this.lastPosY = posY;
        this.visible = true;
        this.img = img;
        this.attack = attack;
    };

    this.updatePos = function(){
        if(this.visible){
            this.lastPosX = this.posX;
            this.lastPosY = this.posY;
            this.posX = this.posX + this.speedX;
            this.posY = this.posY + this.speedY;
            if(this.lastPosY <= this.MapTop || this.lastPosY >= this.MapBottom || this.lastPosX<= this.MapLeft || this.lastPosX>= this.MapRight){
                this.visible = false;
            }
        }
    }

    this.paint = function(drawCanvas){
        if(this.visible){
            drawCanvas.drawImage(this.img, this.posX, this.posY);
        }
    }
}